import java.awt.event

class PyAction(java.awt.event.ActionListener):
	startf = None
	endf = None
	args = None
	c = 0
	parent = None
	
	def __init__(self,startf,endf,args,b,parent=None):
		self.startf = startf
		self.endf = endf
		self.args = args
		self.parent = parent
	def actionPerformed(self, e):
		if self.c == 0:
			ret = self.endf(self.args)
			self.c=1
		else:
			self.c=0
			ret = self.startf(self.args)

